package com.vmj.classfile.entity.attribute;

import com.vmj.classfile.ClassReader;
import com.vmj.classfile.entity.ConstantPool;

/**
 * Created by yangshoujun on 2017/8/6 下午4:26.
 */
public abstract class AbstractAttribute<T> implements Attribute {

    private int attributeNameIndex;
    private int attributeLength;
    private String attributeName;

    ClassReader classReader;
    private ConstantPool constantPool;

    AbstractAttribute(ClassReader classReader) {
        this.classReader = classReader;
    }

    public void setConstantPool(ConstantPool constantPool) {
        this.constantPool = constantPool;
    }

    public abstract void parse();

    public ClassReader getClassReader() {
        return classReader;
    }

    public int getAttributeNameIndex() {
        return attributeNameIndex;
    }

    public int getAttributeLength() {
        return attributeLength;
    }

    public ConstantPool getConstantPool() {
        return constantPool;
    }

    public void setAttributeNameIndex(int attributeNameIndex) {
        this.attributeNameIndex = attributeNameIndex;
    }

    public void setAttributeLength(int attributeLength) {
        this.attributeLength = attributeLength;
    }

    public void setClassReader(ClassReader classReader) {
        this.classReader = classReader;
    }

    public String getAttributeName() {
        return attributeName;
    }

    public void setAttributeName(String attributeName) {
        this.attributeName = attributeName;
    }
}
